package com.pingan.haofang.searchcloud.batch.demo;

import com.pingan.haofang.searchcloud.batch.common.Batch;
import com.pingan.haofang.searchcloud.batch.common.BatchResult;
import com.pingan.haofang.searchcloud.batch.common.BatchRunner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;

/**
 * 定时任务刷新
 *
 * @author LUYI374
 * @date 2017年5月8日
 * @since 1.0.0
 */
@Batch(value = "demoCronTask")
@ConditionalOnProperty("demoCronTask")
public class DemoCronTaskRunner implements BatchRunner {

    static Logger LOG = LoggerFactory.getLogger(DemoCronTaskRunner.class);

    @Override
    public BatchResult run(String[] args) {
        System.out.println(System.currentTimeMillis());
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        System.out.println(System.currentTimeMillis());
        return BatchResult.ALL_SUCCESS;
    }


}
